<template>
    <!-- 修改资料 -->

    <div>
        <!-- 内容主题区域 -->
        <el-form label-width="120px" :model="form" label-position="right" ref="formRef" :disabled="disabled"
            :class="{ 'borderNone': disabled }">
            <el-card>
                <el-row>
                    <el-col :sm="8" :md="8" :lg="8" :xl="8">
                        <el-form-item label="检测能力" prop="checkAbility">
                            <el-radio-group v-model="form.checkAbility" style="margin-top: -4px;">
                                <template v-for="(item, index) in configData.haveNoList" :key="index">
                                    <el-radio :label="item.value" size="large">{{ item.label }}</el-radio>
                                </template>
                            </el-radio-group>
                            <el-input class="borderNone" style="width: 40%" v-if="form.checkAbility == '0'" v-model="noCheckAbilityDesc"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :sm="8" :md="8" :lg="8" :xl="8">
                        <el-form-item prop="purchaseInstrumentation">
                            <template #label>
                                <span v-if="!disabled" style="color: #f56c6c;margin-right: 4px;">*</span>
                                <span style="display:inline-block;">添置检测仪器</span>
                            </template>
                            <el-radio-group v-model="form.purchaseInstrumentation" style="margin-top: -4px;">
                                <template v-for="(item, index) in configData.needList" :key="index">
                                    <el-radio :label="item.value" size="large">{{ item.label }}</el-radio>
                                </template>
                            </el-radio-group>
                            <el-input class="borderNone" style="width: 40%" v-if="form.purchaseInstrumentation == '1'" v-model="form.purchaseEquipmentDesc"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :sm="8" :md="8" :lg="8" :xl="8">
                        <el-form-item label="辅助测量装置" prop="auxiliaryEquipment">
                            <el-select v-if="!disabled" v-model="form.auxiliaryEquipment" clearable placeholder="请选择：">
                                <el-option v-for="item in configData.auxiliaryEquipmentList" :key="item.value"
                                    :label="item.label" :value="item.value">
                                </el-option>
                            </el-select>
                            <el-input v-else v-model="form.auxiliaryEquipmentName"></el-input>
                        </el-form-item>
                    </el-col>
                    </el-row>
                <el-row>
                    <el-col :sm="8" :md="8" :lg="8" :xl="8">
                        <el-form-item label="辅资材" prop="auxiStuffRequire">
                            <el-radio-group v-model="form.auxiStuffRequire" style="margin-top: -4px;">
                                <template v-for="(item, index) in configData.needList" :key="index">
                                    <el-radio :label="item.value" size="large">{{ item.label }}</el-radio>
                                </template>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                    <el-col :sm="8" :md="8" :lg="8" :xl="8">
                        <el-form-item label="检具工装提供者" prop="checkToolSupplier">
                            <el-select v-if="!disabled" v-model="form.checkToolSupplier" clearable placeholder="请选择：">
                                <el-option v-for="item in configData.checkToolSupplierList" :key="item.value"
                                    :label="item.label" :value="item.value">
                                </el-option>
                            </el-select>
                            <el-input v-else v-model="form.checkToolSupplierName"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :sm="8" :md="8" :lg="8" :xl="8">
                        <el-form-item label="组件" prop="checkComponentRequire">
                            <el-radio-group v-model="form.checkComponentRequire" style="margin-top: -4px;">
                                <template v-for="(item, index) in configData.needList" :key="index">
                                    <el-radio :label="item.value" size="large">{{ item.label }}</el-radio>
                                </template>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :sm="8" :md="8" :lg="8" :xl="8">
                        <el-form-item label="检具工装提供者" prop="checkComponentSupplier">
                            <el-select v-if="!disabled" v-model="form.checkComponentSupplier" clearable placeholder="请选择：">
                                <el-option v-for="item in configData.checkToolSupplierList" :key="item.value"
                                    :label="item.label" :value="item.value">
                                </el-option>
                            </el-select>
                            <el-input v-else v-model="form.checkComponentSupplierName"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :sm="8" :md="8" :lg="8" :xl="8">
                        <el-form-item label="ROHS报告" prop="haveRohsReport">
                            <el-select v-if="!disabled" v-model="form.haveRohsReport" clearable placeholder="请选择：">
                                <el-option v-for="item in configData.haveRohsReportList" :key="item.value"
                                    :label="item.label" :value="item.value">
                                </el-option>
                            </el-select>
                            <el-input v-else v-model="form.haveRohsReportName"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :sm="8" :md="8" :lg="8" :xl="8">
                        <el-form-item label="ROHS报告纳期" prop="rohsReportNaperiod">
                            <el-date-picker v-if="!disabled" v-model="form.rohsReportNaperiod" type="date" value-format="YYYY-MM-DD"
                                placeholder="请选择日期" />
                                <el-input v-else v-model="form.rohsReportNaperiod"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-col :sm="8" :md="8" :lg="8" :xl="8">
                        <el-form-item prop="qualityResult">
                            <template #label>
                                <span v-if="!disabled" style="color: #f56c6c;margin-right: 4px;">*</span>
                                <span style="display:inline-block;">品质部确认</span>
                            </template>
                            <el-radio-group v-model="form.qualityResult" style="margin-top: -4px;">
                                <template v-for="(item, index) in configData.feasibilityList" :key="index">
                                    <el-radio :label="item.value" size="large">{{ item.label }}</el-radio>
                                </template>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
            </el-card>
        </el-form>
    </div>
</template>

<script setup>
import { ref, onMounted, watch } from 'vue';
import { ElNotification } from 'element-plus';
import Api from '@/api/model/sample'
import sysApi from '@/api/model/system'
const emit = defineEmits(['update:modelValue'])
const props = defineProps({
    modelValue: { type: Object, default: () => { } },
    disabled: { type: Boolean, default: false },
    configData: { type: Object, default: () => { } }
})
const form = ref({})

onMounted(() => {
    form.value = props.modelValue
})

</script>

<style lang="less" scoped>
.borderNone {
    :deep(.el-input__wrapper) {
        box-shadow: 0 0 0 0px var(--el-input-border-color, var(--el-border-color)) inset;
        cursor: default;
        background-color: transparent; //背景颜色透明
        border-bottom: 1px solid #999;
        border-radius: 0;

        .el-input__inner {
            cursor: default !important;
        }
    }
}
</style>

